fold

open fun <R> fold(errorFun: Expected.Transformer<E, R>, valueFun: Expected.Transformer<V, R>): R

Fold the expected to a common type.

Return

result of the value function if this was a value or the errorfunction if this was an error.

Parameters

errorFun

Function handling the case when error is present.

valueFun

Function handling the case when value is present.